<script setup lang="ts">
import { useAppFooterRouteNames as routeWhiteList } from "~/config";
import { useConfigStore } from '@/stores/config'
const route = useRoute();
const router = useRouter();
const configStore = useConfigStore()
function onBack() {
  if (window.history.state.back) history.back();
  else router.replace("/");
}
function goSearch() {
  // router.push("/home/search" )
  configStore.setSearchStatus(true)
}
const { t } = useI18n();

const title = computed(() => {
  if (!route.meta) return "";
  return route.meta.i18n ? t(route.meta.i18n) : route.meta.title || "";
});

const showLeftArrow = computed(
  () => route.name && routeWhiteList.includes(route.name)
);
const gold = ref("");
</script>

<template>
  <van-nav-bar left-arrow title="LUVA slots" @click-left="onBack" fixed>
    <template #right>
      <van-icon name="search" size="18" @click="goSearch" />
    </template>
  </van-nav-bar>
</template>
